<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    html,
    body {
      height: 100%;
      margin: 0;
      padding: 0;
    }
    #root {
      height: 100%;
      display: flex;
    }
    .yang {
      border: 3px solid aqua;
      height: 100%;
      flex: 1;
      background-image: url(./蒂法.jpg);
      background-repeat: no-repeat;
      background-size: 300px;
      background-position: bottom right;
      /* opacity: 0.7; */
    }
    .ruby {
      border: 3px solid pink;
      height: 100%;
      flex: 1;
      background-image: url(./爱丽丝.jpg);
      background-repeat: no-repeat;
      background-size: 300px;
      background-position: bottom right;
      /* opacity: 0.7; */
    }
  </style>
  <body>
    <div id="root">
      <textarea class="yang" :value="tt" @input="iptFn"></textarea>
      <div v-html="mark" class="ruby"></div>
    </div>
  </body>
</html>
<script src="https://cdn.bootcdn.net/ajax/libs/marked/1.2.7/marked.min.js"></script>
<!-- <script src="./防抖和节流封装.js"></script> -->
<script src="http://unpkg.zhimg.com/vue@2"></script>
<script type="module">
  import { debounce } from "./防抖和节流封装.js"
  const vm = new Vue({
    el: "#root",
    data: {
      tt: ""
    },
    computed: {
      mark() {
        return marked(this.tt)
      }
    },
    methods: {
      iptFn: debounce(function (e) {
        console.log(111)
        this.tt = e.target.value
      }, 1000)
    }
  })
</script>
